package jk.fox.config.registry.zookeeper;

import jk.fox.config.registry.RegistryConfiguration;
import jk.fox.registry.Registry;
import jk.fox.registry.zookeeper.ZookeeperRegistry;
import lombok.Getter;
import lombok.Setter;

/**
 * @author cuichao
 * @Description: ZookeeperConfiguration
 * @Date: create in 2020/5/14 15:57
 */
@Getter
@Setter
public class ZookeeperConfiguration extends RegistryConfiguration {

    /**
     * 服务器地址
     */
    private String serverAddress = "127.0.0.1:2181";
    /**
     * 最大重试次数
     */
    private int maxRetires = 3;
    /**
     * 重试间隔毫秒数
     */
    private int retryIntervalMs = 1000;
    /**
     * 连接超时时间
     */
    private int connectionTimeoutMs = 15000;
    /**
     * 会话超时时间
     */
    private int sessionTimeoutMs = 5000;


    @Override
    public Registry create(Object obj) {
        return new ZookeeperRegistry(this);
    }
}
